using System;
using System.IO;

namespace DZTC.UselessAppEver.Core
{
    public static class FileHelpers
    {

        public static bool CheckFileNameCorrectness(string fileName)
        {
            try
            {
                var fi = new FileInfo(fileName);
                return true;
            }
            catch (ArgumentException)
            {
            }
            catch (PathTooLongException)
            {
            }
            catch (NotSupportedException)
            {
            }

            return false;
        }

        public static bool TryDeleteFile(string fileName)
        {
            try
            {
                File.Delete(fileName);
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
    }
}